import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Ballenas here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Ballenas extends Enemigos
{
    /**
     * Act - do whatever the Ballenas wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
     private GreenfootImage ballena1=new GreenfootImage("ballena1.png");
     private GreenfootImage ballena2=new GreenfootImage("ballena2.png");
      
     private GreenfootImage ballena3=new GreenfootImage("ballena3.png");
     private int numero;
    public void act() 
    {
        int rand=Greenfoot.getRandomNumber(200);
       if(rand==1){getWorld().addObject(new Burbujas(), getX(), getY()+30);}
       movimiento();
       this.move(1);
        
    }    

    public Ballenas(){
    
    numero =0;
    setImage(ballena2);
    }
   
    public void movimiento(){
        numero++;
    if(numero==20){setImage(ballena1);}
    if(numero==40){setImage(ballena2);}
    if(numero==60){setImage(ballena3);numero=0;}
    
    }
}